<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>hwicap: xhwicap_intr_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">hwicap
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xhwicap__intr__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xhwicap_intr_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example using the HwIcap driver (<a class="el" href="struct_x_hw_icap.html" title="The XHwIcap driver instance data. ">XHwIcap</a>) and the HwIcap device using the interrupt mode. </p>
<dl class="section note"><dt>Note</dt><dd>None.</dd></dl>
<p>*****WARNING ************</p>
<p>This is not an example that can be used directly. This example gives the sequence of steps that need to be done for programming the FPGA with a given configuration(partial) file. This configuration file differs from each system and each version of the FPGA device.</p>
<pre></pre><pre>  MODIFICATION HISTORY:</pre><pre>  Ver   Who  Date     Changes
</p>
<hr/>
<p>
  2.00a sv   09/29/07 First release
  4.00a hvm  12/1/09  Updated with HAL phase 1 changes
  5.00a hvm  2/25/10  Updated with S6 support
  10.0  bss  6/24/14  Removed support for families older than 7 series
  11.0  ms   01/23/17 Added xil_printf statement in main function to
                      ensure that "Successfully ran" and "Failed" strings
                      are available in all examples. This is a fix for
                      CR-965028.
  11.2 Nava 01/30/19  Replaced #error with #pragma message since the information
                      related to #error is not an error info. It provides an
                      information about the example behaviour.
  11.6 Nava 06/22/23  Added support for system device-tree flow.
  11.7 Nava 02/06/25  Updated HWICAP_BASEADDR to use XPAR_HWICAP_0_BASEADDR
                      instead of XPAR_XHWICAP_0_BASEADDR to align with YAML
                      changes.
*</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae0c9d1a60762a9c150b8814b0912a32a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhwicap__intr__example_8c.html#ae0c9d1a60762a9c150b8814b0912a32a">HwIcapIntrExample</a> (XIntc *IntcInstancePtr, <a class="el" href="struct_x_hw_icap.html">XHwIcap</a> *HwIcapInstancePtr, u16 HwIcapDeviceId, u16 HwIcapIntrId)</td></tr>
<tr class="memdesc:ae0c9d1a60762a9c150b8814b0912a32a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function does a minimal test on the HwIcap device and driver as a design example.  <a href="#ae0c9d1a60762a9c150b8814b0912a32a">More...</a><br/></td></tr>
<tr class="separator:ae0c9d1a60762a9c150b8814b0912a32a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55e13a275c27bf0eba8bd30a639dd756"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhwicap__intr__example_8c.html#a55e13a275c27bf0eba8bd30a639dd756">HwIcapIntrHandler</a> (void *CallBackRef, u32 StatusEvent, u32 ByteCount)</td></tr>
<tr class="memdesc:a55e13a275c27bf0eba8bd30a639dd756"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the handler which performs processing for the HwIcap driver.  <a href="#a55e13a275c27bf0eba8bd30a639dd756">More...</a><br/></td></tr>
<tr class="separator:a55e13a275c27bf0eba8bd30a639dd756"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhwicap__intr__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function to call the HwIcap interrupt example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ae0c9d1a60762a9c150b8814b0912a32a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HwIcapIntrExample </td>
          <td>(</td>
          <td class="paramtype">XIntc *&#160;</td>
          <td class="paramname"><em>IntcInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_hw_icap.html">XHwIcap</a> *&#160;</td>
          <td class="paramname"><em>HwIcapInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>HwIcapDeviceId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>HwIcapIntrId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function does a minimal test on the HwIcap device and driver as a design example. </p>
<p>The purpose of this function is to illustrate how to use the <a class="el" href="struct_x_hw_icap.html" title="The XHwIcap driver instance data. ">XHwIcap</a> component using the interrupt mode.</p>
<p>This function sends data and expects to receive the same data.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">IntcInstancePtr</td><td>is a pointer to the instance of the INTC component. </td></tr>
    <tr><td class="paramname">HwIcapInstancePtr</td><td>is a pointer to the instance of HwIcap component. </td></tr>
    <tr><td class="paramname">HwIcapDeviceId</td><td>is the Device ID of the HwIcap Device and is the XPAR_&lt;HWICAP_instance&gt;_DEVICE_ID value from xparameters.h. </td></tr>
    <tr><td class="paramname">HwIcapIntrId</td><td>is the interrupt Id and is typically XPAR_&lt;INTC_instance&gt;_&lt;HWICAP_instance&gt;_IP2INTC_IRPT_INTR value from xparameters.h .</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, otherwise XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>This function contains an infinite loop such that if interrupts are not working it may never return. </p>

<p>References <a class="el" href="struct_x_hw_icap___config.html#a6be849d17f51b639414cae9620f2dcd5">XHwIcap_Config::BaseAddress</a>, <a class="el" href="struct_x_hw_icap.html#aab0ffe813aa173907a53fbdfe62de599">XHwIcap::HwIcapConfig</a>, <a class="el" href="xhwicap__intr__example_8c.html#a55e13a275c27bf0eba8bd30a639dd756">HwIcapIntrHandler()</a>, <a class="el" href="group__hwicap.html#ga3d51a2ca2954770e68e8304c6d45a797">XHI_IPIXR_WRP_MASK</a>, <a class="el" href="group__hwicap.html#gad497b5129aff666181e85457f1c5f678">XHwIcap_CfgInitialize()</a>, <a class="el" href="group__hwicap.html#gaab446328af0c5b397eeaee15088bf8e8">XHwIcap_DeviceWrite()</a>, <a class="el" href="group__hwicap.html#gabf5d9b150a34fa3759415531b833f81a">XHwIcap_IntrEnable</a>, <a class="el" href="group__hwicap.html#ga9cf1ff1dd1056a11f65a903c47492842">XHwIcap_IntrHandler()</a>, <a class="el" href="group__hwicap.html#gadead7aef30c83eb98380b986884b0e6f">XHwIcap_LookupConfig()</a>, <a class="el" href="group__hwicap.html#ga0716d6a3c65aabb73344bee9c4c9cfc7">XHwIcap_SelfTest()</a>, <a class="el" href="group__hwicap.html#gaa2f2f23cf842c10f443509f8861a194a">XHwIcap_SetInterruptHandler()</a>, and <a class="el" href="group__hwicap.html#ga4306e4bf6223f5f27a2d971657028f47">XHwIcap_Type1Read</a>.</p>

<p>Referenced by <a class="el" href="xhwicap__intr__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a55e13a275c27bf0eba8bd30a639dd756"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void HwIcapIntrHandler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>StatusEvent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>ByteCount</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the handler which performs processing for the HwIcap driver. </p>
<p>It is called from an interrupt context such that the amount of processing performed should be minimized. It is called when a transfer of HwIcap data completes or an error occurs.</p>
<p>This handler provides an example of how to handle HwIcap interrupts and is application specific.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CallBackRef</td><td>is the upper layer callback reference passed back when the callback function is invoked. </td></tr>
    <tr><td class="paramname">StatusEvent</td><td>is the event that just occurred. </td></tr>
    <tr><td class="paramname">WordCount</td><td>is the number of words (32 bit) transferred up until the event occurred.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xhwicap__intr__example_8c.html#ae0c9d1a60762a9c150b8814b0912a32a">HwIcapIntrExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function to call the HwIcap interrupt example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, otherwise XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>References <a class="el" href="xhwicap__intr__example_8c.html#ae0c9d1a60762a9c150b8814b0912a32a">HwIcapIntrExample()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
